﻿using System;
using TecBaseObjects.Base;

namespace TecBaseObjects.Objects {

    public class BusinessCaseStatusObj : MyBaseModel, IEquatable<BusinessCaseStatusObj>, IComparable<BusinessCaseStatusObj> {

        #region members

        private byte projectStatus;
        private string stateText;
        private string filePath;

        #endregion

        #region Constructor

        public BusinessCaseStatusObj() {

        }

        #endregion

        #region Properties

        public byte ProjectStatus {
            get {
                return this.projectStatus;
            }
            set {
                if (this.projectStatus == value) {
                    return;
                }
                this.projectStatus = value;
                OnPropertyChanged(() => ProjectStatus);
            }
        }

        public string StateText {
            get {
                return this.stateText;
            }
            set {
                if (this.stateText == value) {
                    return;
                }
                this.stateText = value;
                OnPropertyChanged(() => StateText);
            }
        }

        public string FilePath {
            get {
                return this.filePath;
            }
            set {
                if (this.filePath == value) {
                    return;
                }
                this.filePath = value;
                OnPropertyChanged(() => FilePath);
            }
        }

        #endregion

        #region Functions

        public int CompareTo(BusinessCaseStatusObj comparePart) {
            // A null value means that this object is greater.
            if (comparePart == null)
                return 1;

            else
                return this.ProjectStatus.CompareTo(comparePart.ProjectStatus);
        }

        public bool Equals(BusinessCaseStatusObj other) {
            if (other == null) return false;
            return (this.ProjectStatus.Equals(other.ProjectStatus));
        }

        #endregion

        #region Overide

        public override bool Equals(object obj) {
            if (obj == null) return false;
            BusinessCaseStatusObj objAsPart = obj as BusinessCaseStatusObj;
            if (objAsPart == null) return false;
            else return Equals(objAsPart);
        }

        public override int GetHashCode() {
            return this.ProjectStatus;
        }

        public override string ToString() {
            return "ID: " + this.ProjectStatus.ToString() + "   Status: " + this.StateText;
        }

        #endregion

    }
}
